package com.huishu.tcm.service.serviceImpl;

import com.huishu.tcm.entity.Institution;
import com.huishu.tcm.mapper.InstitutionMapper;
import org.springframework.stereotype.Service;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huishu.tcm.service.InstitutionService;

@Service
public class InstitutionServiceImpl extends ServiceImpl<InstitutionMapper, Institution> implements InstitutionService {

	 /**
     * 筛选条件
     * @param v
     * @return
     */
    @Override
    public QueryWrapper<Institution> getQueryWrapper(Institution v){
        QueryWrapper<Institution> queryWrapper = new QueryWrapper<>();
        if(ObjectUtil.isEmpty(v)){
            return queryWrapper;
        }
		if(ObjectUtil.isNotEmpty(v.getId())){
        	queryWrapper.eq("id", v.getId());
        }
       	return queryWrapper;
    }
}